﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HR_Business
{
    public partial class Company 
    {
        HRDBContext _DatabaseContext;

        public Company() : this(new HRDBContext()) { }

        public Company(HRDBContext HRDBContext)
        {
            _DatabaseContext = HRDBContext;
        }
       
        public Company GetCompanyByCompanyId(int CompanyId)
        {
            return _DatabaseContext.Companies.FirstOrDefault(Company => Company.Id == CompanyId);
        }

        public List<Company> GetAllCompanies()
        {
            return _DatabaseContext.Companies.ToList();
        }


    }
}
